package com.rw.common.pojo;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@NoArgsConstructor
public class Menu {

    private Integer id;

    private Integer pid;

    private String title;

    private String name;

    private String href;

    private String icon;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private List<Menu> child;

    public Menu(Integer id, Integer pid, String name, String href, String icon) {
        this.id = id;
        this.pid = pid;
        this.title = name;
        this.name= name;
        this.href = href;
        this.icon = icon;
    }

    public void setName(String name) {
        this.title = name;
        this.name = name;
    }
}
